@aliou/obsdx-base-engine 0.0.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/index.d.mts +95 -0
- package/dist/index.mjs +1159 -0
- package/dist/index.mjs.map +1 -0
- package/package.json +32 -0
package/dist/index.d.mts
ADDED
|
@@ -0,0 +1,95 @@
|
|
|
1
|
+
import { BaseDefinition, Expr } from "@aliou/obsdx-base-ast";
|
|
2
|
+
|
|
3
|
+
//#region src/result.d.ts
|
|
4
|
+
type BaseQueryMeta = {
|
|
5
|
+
type?: string;
|
|
6
|
+
name?: string;
|
|
7
|
+
filters?: unknown;
|
|
8
|
+
order: string[];
|
|
9
|
+
sort?: unknown[];
|
|
10
|
+
limit?: number;
|
|
11
|
+
groupBy?: unknown;
|
|
12
|
+
summaries?: Record<string, unknown>;
|
|
13
|
+
};
|
|
14
|
+
type BaseQueryRow = {
|
|
15
|
+
file: {
|
|
16
|
+
path: string;
|
|
17
|
+
name: string;
|
|
18
|
+
};
|
|
19
|
+
data: Record<string, unknown>;
|
|
20
|
+
};
|
|
21
|
+
type BaseQueryResult = {
|
|
22
|
+
base: string;
|
|
23
|
+
view?: string;
|
|
24
|
+
context?: string;
|
|
25
|
+
meta: BaseQueryMeta;
|
|
26
|
+
columns: BaseColumn[];
|
|
27
|
+
rows: BaseQueryRow[];
|
|
28
|
+
groups: unknown[];
|
|
29
|
+
summaries: Record<string, unknown>;
|
|
30
|
+
};
|
|
31
|
+
//#endregion
|
|
32
|
+
//#region src/query.d.ts
|
|
33
|
+
type BaseFileInspection = {
|
|
34
|
+
file: {
|
|
35
|
+
path: string;
|
|
36
|
+
name: string;
|
|
37
|
+
basename: string;
|
|
38
|
+
ext: string;
|
|
39
|
+
folder: string;
|
|
40
|
+
kind: string;
|
|
41
|
+
ctime?: string;
|
|
42
|
+
mtime?: string;
|
|
43
|
+
size?: number;
|
|
44
|
+
indexedAt?: string;
|
|
45
|
+
parseError?: string | null;
|
|
46
|
+
};
|
|
47
|
+
properties: Array<{
|
|
48
|
+
name: string;
|
|
49
|
+
value: unknown;
|
|
50
|
+
valueType?: string | null;
|
|
51
|
+
}>;
|
|
52
|
+
tags: Array<{
|
|
53
|
+
tag: string;
|
|
54
|
+
}>;
|
|
55
|
+
links: Array<{
|
|
56
|
+
resolvedPath?: string | null;
|
|
57
|
+
targetText?: string | null;
|
|
58
|
+
}>;
|
|
59
|
+
backlinks: unknown[];
|
|
60
|
+
embeds: Array<{
|
|
61
|
+
resolvedPath?: string | null;
|
|
62
|
+
targetText?: string | null;
|
|
63
|
+
}>;
|
|
64
|
+
};
|
|
65
|
+
type BaseQueryOptions = {
|
|
66
|
+
view?: string;
|
|
67
|
+
context?: string;
|
|
68
|
+
};
|
|
69
|
+
type BaseColumn = {
|
|
70
|
+
id: string;
|
|
71
|
+
displayName: string;
|
|
72
|
+
type: string;
|
|
73
|
+
};
|
|
74
|
+
declare function queryBase(base: BaseDefinition, inspections: BaseFileInspection[], options?: BaseQueryOptions): BaseQueryResult;
|
|
75
|
+
//#endregion
|
|
76
|
+
//#region src/expressions/evaluator.d.ts
|
|
77
|
+
declare class BaseEngineError extends Error {
|
|
78
|
+
readonly code: string;
|
|
79
|
+
readonly details: Record<string, unknown>;
|
|
80
|
+
constructor(code: string, message: string, details?: Record<string, unknown>);
|
|
81
|
+
}
|
|
82
|
+
type EvaluationContext = {
|
|
83
|
+
row: BaseFileInspection;
|
|
84
|
+
context?: BaseFileInspection;
|
|
85
|
+
formulas: Record<string, unknown>;
|
|
86
|
+
byPath: Map<string, BaseFileInspection>;
|
|
87
|
+
byBasename: Map<string, BaseFileInspection>;
|
|
88
|
+
value?: unknown;
|
|
89
|
+
acc?: unknown;
|
|
90
|
+
values?: unknown[];
|
|
91
|
+
};
|
|
92
|
+
declare function evaluateExpression(expr: Expr, context: EvaluationContext): unknown;
|
|
93
|
+
//#endregion
|
|
94
|
+
export { type BaseColumn, BaseEngineError, type BaseFileInspection, type BaseQueryOptions, type BaseQueryResult, type EvaluationContext, evaluateExpression, queryBase };
|
|
95
|
+
//# sourceMappingURL=index.d.mts.map
|